<template>
<div class="date-inline-group">
	<label class="control-label">{{label}}</label>
	<div class="input-append date form_datetime">
			<input class=form-control type="text" :name="name" v-el:date :readonly="readOnly">
			<span class="add-on"><i class="icon-th"></i></span>
	</div>
</div>

</template>

<style lang="css" src="plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css"></style>
<style scoped>
	.date-inline-group {
		display: inline-block;
	}
	.date-inline-group > * {
		display: inline-block;
	}
</style>
<script>
import 'plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js'
$.fn.datetimepicker.dates['zh-CN'] = {
		days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
		daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
		daysMin:  ["日", "一", "二", "三", "四", "五", "六", "日"],
		months: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
		monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
		today: "今天",
		suffix: [],
		meridiem: ["上午", "下午"]
};
export default {
	props: {
		label:{type: String},
		name: {type: String},
        readOnly: {type: Boolean, default: false}
	},
	ready() {

    $(".form_datetime > input").datetimepicker({
        language :"zh-CN",
        format: "yyyy-MM-dd",
        autoclose: true,
        todayBtn: true,
		timepicker:false,
		linkFormat: "yyyy-mm-dd",
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0
    });

	}
}
</script>
